package com.yasaka.stock.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.yasaka.stock.feign.OcrFeignClient;

@RestController
public class OcrController {

	@Autowired
	private OcrFeignClient ocrFeignClient;

	@RequestMapping(value = "/ocr/upload", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public String upload(MultipartFile userFile) {
		return ocrFeignClient.upload(userFile);
	}

	@RequestMapping(value = "/ocr/getContent", method = RequestMethod.GET)
	public String getContent(String id) {
		return ocrFeignClient.getContent(id);
	}
}
